<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="js/rem.js"></script>
		<script type="text/javascript" src="js/iscroll.js"></script>
		<script type="text/javascript">
			var myscroll;
			function loaded(){
				setTimeout(function(){
					myscorll = new iScroll('wrapper',{
						hScroll:true,
						hScrollbar:false,
						vScrollbar:false
					});
				},100)
			}
			window.addEventListener('load',loaded,false);
		</script>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" href="css/common.css" />
		<link rel="stylesheet" type="text/css" href="css/index.css"/>	
		<link rel="stylesheet" type="text/css" href="css/index_1.css"/>
		<link rel="stylesheet" type="text/css" href="css/search.css"/>
		<script type="text/javascript" src="js/jquery-1.11.0.js"></script>
	</head>
	<body>
		<header>发现</header>
		<div class="form">
			<div class="formbox">
				<input type="text" placeholder="请输入昵称" id="txt"/>
				<input type="button" name="" id="search" value="搜索"/>
			</div>
		</div>
		<div class="container" id="wrapper">
			<div class="unitbox" id="scorller">
				<div class="unit"></div>
			
				<script type="text/javascript">
					$("#search").click(function(){
						var txt = $("#txt").val();
						var id = localStorage.getItem("id");
						$.ajax({
							type:"get",
							url:"http://localhost:8080/Proxy/FootBall/user/json/queryall.do",
							async:true,
							data:{
								"keyword":txt,
								'loginsuserid':id,
								"page.pageNo":2
							},
							success:function(rsp){
								console.log(rsp);
								var rsp = JSON.parse(rsp);
								var length = rsp.data.userlist.length;
								var str = '';
								for(var i = 0; i < length; i ++){
									str +='<div class="unithead"><dl><dt><img src="http://101.200.173.217:8080/FootBall' + rsp.data.userlist[i].avatarpath + '" alt="" /></dt><dd><p class="userinfo"><span class="username">' + rsp.data.userlist[i].loginname + '</span><span class="focus" data-id="' + rsp.data.userlist[i].id + '">关注</span></p><p class="usersign">个人签名</p></dd><div class="clb"></div></dl></div>';
								}
								$(".unit").html(str);
								
								var idArr = [];
								$(".focus").click(function(){
									$(this).addClass("nofocus");
									idArr.push($(this).attr("data-id"));
									localStorage.setItem("otherId",idArr);
								});
							}
						});
					});
				</script>
			</div>
		</div>
		<footer id="foot">
			<img class="cream" src="img/cream.png" alt="" />
			<div class="bottomleft">
				<a href="index.html">
					<dl>
						<dt><i class="iconfont ">&#xe65c;</i></dt>
						<dd class="quickseltxt ">首页</dd>
					</dl>
				</a>
				<a href="search.html">
					<dl>
						<dt><i class="iconfont active">&#xe669;</i></dt>
						<dd class="quickseltxt active">发现</dd>
					</dl>
				</a>
			</div>
			<div class="bottomright">
				<a href="user.html">
					<dl>
						<dt><i class="iconfont">&#xe674;</i></dt>
						<dd class="quickseltxt">我的</dd>
					</dl>
				</a>
				<a href="index.html">
					<dl>
						<dt><i class="iconfont">&#xe644;</i></dt>
						<dd class="quickseltxt">退出</dd>
					</dl>
				</a>
			</div>
		</footer>
	</body>
</html>
